package com.example.pageable.controller;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.common.utils.R;
import com.example.pageable.entity.WorkOrderEntity;
import com.example.pageable.service.IWorkOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
public class MyController {
    @Autowired
    IWorkOrderService workOrderService;

    @GetMapping("/page")
    public R page(@RequestParam("page") int page, @RequestParam("size") int size){
        Map<String, Object> params = new HashMap<>();
        params.put("age", 18);
        List<WorkOrderEntity> ret = workOrderService.selectPageVo(page, size,params );
        return R.ok().setData(ret);
    }

}
